<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
	<script type="text/javascript" src="../js/jquery-3.4.1.js"></script>
	<script type="text/javascript">
	function login(){
				$.ajax({
					async : false,
					url : "../controller/login",
					data : $("#form1").serialize(),
					type : "get",
					dataType : "json",
					success : function(data){
						alert(data.aa);
						if(data.aa === 'admin'){
							alert("超级管理员");
							location.href = "../html/Home.html";
						}else if(data.aa === 'manager'){
							alert("普通管理员");
							location.href = "../html2/Home.html";
						}else if(data.aa === '已登录'){
							alert("用户已经登陆。。。。返回登陆页面");
							location.href = "../html/login.html";
						}else{
							alert("登录失败")
							location.href = "../html/login.html";
						}

					}
				})
			}
	</script>

</head>
<style type="text/css">
	html{
		width: 100%;
		height: 100%;
		overflow: hidden;
		font-style: sans-serif;
	}
	body{
		width: 100%;
		height: 100%;
		font-family: 'Open Sans',sans-serif;
		margin: 0;
	}
	#login{
		position: absolute;
		top: 50%;
		left:50%;
		margin: -150px 0 0 -150px;
		width: 300px;
		height: 300px;
		padding-left:40px;
		padding-right:40px;
		background-color:gray;
		opacity:0.7;
		border: 2px solid gray;
	}
	#login h1{
		color: blue;
		text-shadow:0 0 10px;
		letter-spacing: 1px;
		text-align: center;
	}
	h1{
		font-size: 2em;
		margin: 0.67em 0;
	}
	.inp{
		width: 278px;
		height: 18px;
		margin-bottom: 10px;
		padding: 10px;
		font-size: 13px;
		color: #fff;
		text-shadow:1px 1px 1px;
		border-top: 1px solid #312E3D;
		border-left: 1px solid #312E3D;
		border-right: 1px solid #312E3D;
		border-bottom: 1px solid #56536A;
		border-radius: 4px;
		background-color: #2D2D3F;
	}
	.but{
		width: 300px;
		min-height: 20px;
		display: block;
		background-color: #4a77d4;
		border: 1px solid #3762bc;
		color: #fff;
		padding: 9px 14px;
		font-size: 15px;
		line-height: normal;
		border-radius: 5px;
		margin: 0;
	}

</style>
<body background="../img/aa.png">
<div id="login">
	<form id="form1">
		<h1>Login</h1>
		<font color="red"></font>
		<input type="text" class="inp" placeholder="用户名" name="name"></input>
		<input type="password"  class="inp" placeholder="密码" name="pwd"></input>
		<input type="button" class="but" value="登录" onclick="login()" id="sb1"/>
	</form>
</div>
</body>
</html>